package com.zhongyu.item.consumer.controller;

import com.zhongyu.comm.vo.PageResult;
import com.zhongyu.comm.vo.Result;
import com.zhongyu.item.consumer.elastic.ItemDto;
import com.zhongyu.item.consumer.service.ItemDocService;
import com.zhongyu.item.consumer.service.ItemTypeService;
import com.zhongyu.item.consumer.vo.ItemTypeVo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class TicketListController {

    @Resource
    private ItemTypeService itemTypeService;
    @Resource
    private ItemDocService itemDocService;

    @RequestMapping("/p/type/queryItemType")
    public Result queryItemType(@RequestBody ItemTypeVo itemTypeVo){
        List<ItemTypeVo> list=itemTypeService.queryItemType(itemTypeVo);
                return Result.success(list);
    }
    @RequestMapping("/p/list/queryItemList")
    public  Result queryItemList(@RequestBody ItemDto itemDto){
      PageResult pageResult= itemDocService.queryItemList(itemDto);
        return  Result.success(pageResult);
    }
}
